package com.hc.acoustics.bean.contact;

import androidx.annotation.IntDef;

import com.hc.acoustics.R;
import com.hc.acoustics.base.BaseActivity;
import com.hc.acoustics.ui.activity.Type2Formula1Activity;
import com.hc.acoustics.ui.activity.Type2Formula2Activity;
import com.hc.acoustics.ui.activity.Type2Formula3Activity;
import com.hc.acoustics.ui.activity.Type2Formula5Activity;
import com.hc.acoustics.ui.activity.Type2Formula6Activity;
import com.hc.acoustics.ui.activity.Type2Formula7Activity;
import com.hc.acoustics.ui.activity.Type3Formula1Activity;
import com.hc.acoustics.ui.activity.Type3Formula2Activity;
import com.hc.acoustics.ui.activity.Type3Formula3Activity;
import com.hc.acoustics.ui.activity.Type3Formula4Activity;
import com.hc.acoustics.ui.activity.Type3Formula5Activity;
import com.hc.acoustics.ui.activity.Type3Formula6Activity;
import com.hc.acoustics.ui.activity.Type3Formula7Activity;
import com.hc.acoustics.ui.activity.Type4Formula1Activity;
import com.hc.acoustics.ui.activity.Type4Formula2Activity;
import com.hc.acoustics.ui.activity.Type4Formula3Activity;
import com.hc.acoustics.ui.activity.Type4Formula4Activity;
import com.hc.acoustics.ui.activity.Type5Formula1Activity;
import com.hc.acoustics.ui.activity.Type5Formula2Activity;
import com.hc.acoustics.ui.activity.Type6Formula1Activity;
import com.hc.acoustics.ui.activity.Type2Formula4Activity;
import com.hc.acoustics.ui.activity.Type6Formula2Activity;
import com.hc.acoustics.ui.activity.Type6Formula3Activity;
import com.hc.acoustics.ui.activity.Type6Formula4Activity;
import com.hc.acoustics.ui.activity.Type6Formula5Activity;
import com.hc.acoustics.ui.activity.Type6Formula6Activity;
import com.hc.acoustics.ui.activity.Type7Formula1Activity;
import com.hc.acoustics.ui.activity.Type7Formula2Activity;
import com.hc.acoustics.ui.activity.Type7Formula3Activity;
import com.hc.acoustics.ui.activity.Type7Formula4Activity;
import com.hc.acoustics.ui.activity.Type7Formula5Activity;
import com.hc.acoustics.ui.activity.WebActivity;
import com.yc.yclibrary.base.YcAppCompatActivity;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.Arrays;
import java.util.List;

/**
 *
 */
public class FormulaType {
    public static List<String> getData(@MainType.State int state) {
        switch (state) {
            default:
            case MainType.State.Main_1:
                return Arrays.asList();
            case MainType.State.Main_2:
                return Arrays.asList("频率->波长->周期", "声压级衰减", "已知频率求时间", "声压级叠加", "声压级相减", "干涉频率与距离差", "房间共振频率计算");
            case MainType.State.Main_3:
                return Arrays.asList("电压转换", "电声dB的关系", "功放增益->放大倍数", "功放信号->放大倍数"
                        , "功放灵敏度->放大倍数", "同信号、同幅度、不同相位叠加", "同信号、不同幅度、不同相位叠加");
            case MainType.State.Main_4:
                return Arrays.asList("限幅器(已知电压增益)", "限幅器(已知放大倍数)", "限幅器(使用万用表)"
                        , "限幅器(已知功放灵敏度)");
            case MainType.State.Main_5:
                return Arrays.asList("超低音心形指向简单计算①", "超低音心形指向简单计算②");
            case MainType.State.Main_6:
                return Arrays.asList("线阵列近场距离", "带宽到Q值的转换", "补声音箱延时的计算", "波瓣数量计算", "天花喇叭覆盖范围计算", "双低音音箱低音分频上限");
            case MainType.State.Main_7:
                return Arrays.asList("最大物理距离(MPD)", "单个话筒所需声学增益(NAG)", "开启话筒数量NOM", "潜在声学增益PAG", "潜在声学增益参数设计");
            case MainType.State.Main_8:
                return Arrays.asList();
            case MainType.State.Main_9:
                return Arrays.asList();
        }
    }

    public static void toFormulaActivity(BaseActivity activity, @MainType.State int state, int position) {
        switch (state) {
            default:
                activity.showToast("敬请期待");
                break;
            case MainType.State.Main_1:
                break;
            case MainType.State.Main_2:
                switch (position) {
                    default:
                        activity.showToast("敬请期待");
                        break;
                    case 0:
                        Type2Formula1Activity.newInstance(activity, getData(state).get(position));
                        break;
                    case 1:
                        Type2Formula2Activity.newInstance(activity, getData(state).get(position));
                        break;
                    case 2:
                        Type2Formula3Activity.newInstance(activity, getData(state).get(position));
                        break;
                    case 3:
                        Type2Formula4Activity.newInstance(activity, getData(state).get(position));
                        break;
                    case 4:
                        Type2Formula5Activity.newInstance(activity, getData(state).get(position));
                        break;
                    case 5:
                        Type2Formula6Activity.newInstance(activity, getData(state).get(position));
                        break;
                    case 6:
                        Type2Formula7Activity.newInstance(activity, getData(state).get(position));
                        break;
                }
                break;
            case MainType.State.Main_3:
                switch (position) {
                    default:
                        activity.showToast("敬请期待");
                        break;
                    case 0:
                        Type3Formula1Activity.newInstance(activity, getData(state).get(position));
                        break;
                    case 1:
                        Type3Formula5Activity.newInstance(activity, getData(state).get(position));
                        break;
                    case 2:
                        Type3Formula2Activity.newInstance(activity, getData(state).get(position));
                        break;
                    case 3:
                        Type3Formula3Activity.newInstance(activity, getData(state).get(position));
                        break;
                    case 4:
                        Type3Formula4Activity.newInstance(activity, getData(state).get(position));
                        break;
                    case 5:
                        Type3Formula6Activity.newInstance(activity, getData(state).get(position));
                        break;
                    case 6:
                        Type3Formula7Activity.newInstance(activity, getData(state).get(position));
                        break;
                }
                break;
            case MainType.State.Main_4:
                switch (position) {
                    default:
                        activity.showToast("敬请期待");
                        break;
                    case 0:
                        Type4Formula1Activity.newInstance(activity, getData(state).get(position));
                        break;
                    case 1:
                        Type4Formula2Activity.newInstance(activity, getData(state).get(position));
                        break;
                    case 2:
                        Type4Formula3Activity.newInstance(activity, getData(state).get(position));
                        break;
                    case 3:
                        Type4Formula4Activity.newInstance(activity, getData(state).get(position));
                        break;
                }
                break;
            case MainType.State.Main_5:
                switch (position) {
                    default:
                        activity.showToast("敬请期待");
                        break;
                    case 0:
                        Type5Formula1Activity.newInstance(activity, getData(state).get(position));
                        break;
                    case 1:
                        Type5Formula2Activity.newInstance(activity, getData(state).get(position));
                        break;
                }
                break;
            case MainType.State.Main_6:
                switch (position) {
                    default:
                        activity.showToast("敬请期待");
                        break;
                    case 0:
                        Type6Formula1Activity.newInstance(activity, getData(state).get(position));
                        break;
                    case 1:
                        Type6Formula2Activity.newInstance(activity, getData(state).get(position));
                        break;
                    case 2:
                        Type6Formula3Activity.newInstance(activity, getData(state).get(position));
                        break;
                    case 3:
                        Type6Formula4Activity.newInstance(activity, getData(state).get(position));
                        break;
                    case 4:
                        Type6Formula5Activity.newInstance(activity, getData(state).get(position));
                        break;
                    case 5:
                        Type6Formula6Activity.newInstance(activity, getData(state).get(position));
                        break;
                }
                break;
            case MainType.State.Main_7:
                switch (position) {
                    default:
                        activity.showToast("敬请期待");
                        break;
                    case 0:
                        Type7Formula1Activity.newInstance(activity, getData(state).get(position));
                        break;
                    case 1:
                        Type7Formula2Activity.newInstance(activity, getData(state).get(position));
                        break;
                    case 2:
                        Type7Formula3Activity.newInstance(activity, getData(state).get(position));
                        break;
                    case 3:
                        Type7Formula4Activity.newInstance(activity, getData(state).get(position));
                        break;
                    case 4:
                        Type7Formula5Activity.newInstance(activity, getData(state).get(position));
                        break;
                }
            case MainType.State.Main_8:
                break;
            case MainType.State.Main_9:
                break;
        }
    }
}
